package com.dingwen.treasure.model.entity.mybatisplus;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 角色和元素对应表
 *
 * @author dingwen
 * @TableName sys_role_element
 * @date 2022/06/20
 */
@TableName(value = "sys_role_element")
@ApiModel(value = "sysRoleElement", description = "角色和元素对应表")
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
public class SysRoleElement extends BaseEntity implements Serializable {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 角色ID
     */
    @ApiModelProperty(value = "角色ID")
    @TableField(value = "role_id")
    private Long roleId;

    /**
     * 元素ID
     */
    @ApiModelProperty(value = "元素ID")
    @TableField(value = "element_id")
    private Long elementId;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * toBuilder = true： 可修改
     *
     * @param createTime
     * @param updateTime
     * @param deleted
     * @param version
     * @param createBy
     * @param updateBy
     * @param remark
     */
    @Builder(toBuilder = true)
    public SysRoleElement(LocalDateTime createTime, LocalDateTime updateTime, Integer deleted, Integer version, String createBy, String updateBy, String remark, Long id, Long roleId, Long elementId) {
        super(createTime, updateTime, deleted, version, createBy, updateBy, remark);
        this.id = id;
        this.roleId = roleId;
        this.elementId = elementId;
    }
}